package com.itheima.work1128;

class ticket{
    public static int n = 100;
    public static synchronized  void  toput() {
        ticket.n--;
        System.out.println(Thread.currentThread().getName() + "窗口卖了一张票\t  现在还剩" + ticket.n + "张票");
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
